package android.longs.study.upgrade.model;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Test;

import android.longs.study.upgrade.dao.UpgradeDao;
import android.longs.study.upgrade.dao.UpgradeDaoImp;

public class UpgradeModelTest {

	private UpgradeDao dao = new UpgradeDaoImp();
	@Test
	public void add() {
		
		UpgradeModel model = new UpgradeModel();
		
		model.appPath = "www.ertyufgd";
		model.isForce = 0;
		model.version = "V 1.0";
		model.versionCode = "170308";
		model.versionDescribe = "这是一次不一样的升级 ";
		
		
		
		
		dao.addUpgradeModel(model);
	}
	
	@Test
	public void queryAll(){
		List<UpgradeModel> queryAll = dao.queryAll();
		for (int i = 0; i < queryAll.size(); i++) {
			
			UpgradeModel upgradeModel = queryAll.get(0);
			System.out.println(upgradeModel.toString());
			
			
		}
	}
	
	@Test
	public void queryLast(){
		UpgradeModel queryLast = dao.queryLast();
		System.out.println(queryLast.toString());
		
	}
	
	
	@Test
	public void deleteOne(){
		
		dao.deleteOne("V 1.0");
	}

}
